<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<rich:panel header="#{messages['product.create.title']}">
	<h:panelGrid ><h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText></h:panelGrid>
	
	<t:panelGrid columns="2">
		<h:outputText></h:outputText>
		<h:panelGroup>
		  	<h:outputText value="*" styleClass="standardText_Mandatory" /> 
			<h:outputText value="#{messages['instruction']}" styleClass="standardText_Instruction" />
		</h:panelGroup>
		
		<h:outputText></h:outputText>
		<t:message for="Code" styleClass="error"></t:message>
	
	    <h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="Code" value="#{messages['product.code.label']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="Code" required="true" size="10" maxlength="10" styleClass="standardText" value="#{productBean.product.code}"></t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="Desc" styleClass="error"></t:message>
	    
		<h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="Desc" value="#{messages['product.desc.label']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="Desc" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.desc}"></t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="Price" styleClass="error"></t:message>
	    
		<h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="Price" value="#{messages['price']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="Price" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.priceDouble}">
	    		<f:convertNumber pattern="#,###,###,##0.00"/>
	    	</t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="Rank" styleClass="error"></t:message>
	    
	    <h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="Rank" value="#{messages['rank']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="Rank" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.rankInteger}">
	    		<f:convertNumber integerOnly="true"/>
	    	</t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="MembershipTerm" styleClass="error"></t:message>
	    
	  	<h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="MembershipTerm" value="#{messages['membership.term']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="MembershipTerm" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.membershiptTerm}">
	    	</t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="RoomEntitlement" styleClass="error"></t:message>
	    
	    <h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="RoomEntitlement" value="#{messages['room.entitlement']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="RoomEntitlement" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.roomEntitlement}"></t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="EntitlementConstraint" styleClass="error"></t:message>
	    
	    <h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="EntitlementConstraint" value="#{messages['entitlement.constraint']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="EntitlementConstraint" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.entitlementConstraint}"></t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="EntitlementYear" styleClass="error"></t:message>
	    
	    <h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="EntitlementYear" value="#{messages['entitlement.year']}" styleClass="standardText_Label" >
		    	
		    </h:outputLabel>
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="EntitlementYear" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.yearInteger}">
	    		<t:validateRegExpr pattern="\d{4}"/>
	    	</t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="RoomMaxPerson" styleClass="error"></t:message>
	    
	    <h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="RoomMaxPerson" value="#{messages['room.max.person']}" styleClass="standardText_Label" >
		    	<f:convertNumber integerOnly="true"/>
		    </h:outputLabel>
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="RoomMaxPerson" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.roomMaxInteger}">
	    		<f:convertNumber integerOnly="true"/>
	    	</t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="AnualMaintenenceAmount" styleClass="error"></t:message>
	    
	    <h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="AnualMaintenenceAmount" value="#{messages['anual.maintenence.amount']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="AnualMaintenenceAmount" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.anualDouble}">
	    		<f:convertNumber pattern="#,###,###,##0.00"/>
	    	</t:inputText>
	    </h:panelGroup>
	    
	     <h:outputText></h:outputText>
		<t:message for="MinDownPaymentPercent" styleClass="error"></t:message>
	    
	    <h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="MinDownPaymentPercent" value="#{messages['min.down.payment.percent']}" styleClass="standardText_Label">
		    </h:outputLabel>
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="MinDownPaymentPercent" required="true" size="50" maxlength="50" styleClass="standardText" value="#{productBean.product.minDownDouble}">
	    		<f:validateLength maximum="100" minimum="0"/>
	    	</t:inputText>
	    </h:panelGroup>
	    
	    
		
		<h:panelGroup></h:panelGroup>
		<h:panelGroup></h:panelGroup>
		
		<h:panelGroup></h:panelGroup>
		<t:panelGroup>
		   <t:panelGrid columns="2">
		   		<h:commandButton value="#{messages['create']}" styleClass="button" action="#{productBean.createAction}"></h:commandButton>
			    <h:commandButton value="#{messages['back']}" styleClass="button" action="listProduct" immediate="true"></h:commandButton>
		   </t:panelGrid>
		</t:panelGroup>
	</t:panelGrid>

</rich:panel>
